<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html">

    <body>
        <ui:composition template="/templates/layoutLogin.xhtml">
            <ui:define name="content">
                <div style="height: 90px"/>
                <div align="center">
                    <h:form id="formId">
                        <p:growl id="growl" autoUpdate="true" sticky="true" life="1000" showDetail="true" />
                        <p:panel id="panelId" header="&nbsp;&nbsp;&nbsp;&ndash;&ndash;&nbsp;ลงทะเบียนเพื่อเข้าสู่ระบบ&nbsp;&ndash;&ndash;" 
                                 style="width: 350px;font-size: small;">
                            <p:focus context="panelId" />
                            <h:panelGrid columns="4">
                                <h:outputText value="ชื่อผู้ใช้" />
                                <h:outputText value=":" />
                                <p:inputText value="#{loginBean.username}" autocomplete="true"
                                             id="username" required="true" requiredMessage="กรุณากรอกชื่อผู้ใช้"/>
                                <p:message for="username" display="icon"/>  

                                <h:outputText value="รหัสผ่าน" />
                                <h:outputText value=":" />
                                <p:password value="#{loginBean.password}" autocomplete="true" feedback="false" 
                                            id="password" required="true" requiredMessage="กรุณากรอกรหัสผ่าน"/>
                                <p:message for="password" display="icon"/> 
                            </h:panelGrid>

                            <h:panelGrid columns="1">
                                <p:commandButton value="เข้าสู่ระบบ" action="#{loginBean.login()}" style="width: 100%"
                                                 update="formId" id="btn" ajax="false" icon="ui-icon-key" />
                            </h:panelGrid>
                        </p:panel>
                    </h:form>
                </div>
            </ui:define>
        </ui:composition>

    </body>
</html>